//
//  MNDAdvancedReturnListCell.m
//  minidai
//
//  Created by Steven.Yung on 2017/5/22.
//  Copyright © 2017年 迷你金服. All rights reserved.
//

#import "MNDAdvancedReturnListCell.h"

@interface MNDAdvancedReturnListCell ()

/*! 标题 */
@property (weak, nonatomic) IBOutlet UILabel *returnTitleLabel;
/*! 回款期数 */
@property (weak, nonatomic) IBOutlet UILabel *returnDeadlineLabel;
/*! 回款金额 */
@property (weak, nonatomic) IBOutlet UILabel *returnMoneyLabel;
/*! 回款本金 */
@property (weak, nonatomic) IBOutlet UILabel *principalLabel;
/*! 回款利息 */
@property (weak, nonatomic) IBOutlet UILabel *interestLabel;
/*! 奖励 */
@property (weak, nonatomic) IBOutlet UILabel *rewardLabel;
/*! 回款日期 */
@property (weak, nonatomic) IBOutlet UILabel *returnDateLabel;
/*! 实际回款日期 */
@property (weak, nonatomic) IBOutlet UILabel *actuallyReturnDateLabel;
@property (weak, nonatomic) IBOutlet UIImageView *gapImageView;

@property (weak, nonatomic) IBOutlet UIView *leftShadowView;
@property (weak, nonatomic) IBOutlet UIView *rightShadowView;

@end

@implementation MNDAdvancedReturnListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.gapImageView.image = [[UIImage imageNamed:@"investment_record_gap"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 1, 0, 1)];
    
    self.leftShadowView.layer.shadowRadius = 3;
    self.leftShadowView.layer.shadowOffset = CGSizeMake(3, 0);
    self.leftShadowView.layer.shadowColor = kColorShadow.CGColor;
    self.leftShadowView.layer.shadowOpacity = 0.4;
    
    self.rightShadowView.layer.shadowRadius = 3;
    self.rightShadowView.layer.shadowOffset = CGSizeMake(-3, 0);
    self.rightShadowView.layer.shadowColor = kColorShadow.CGColor;
    self.rightShadowView.layer.shadowOpacity = 0.4;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)configCellWithModel:(MNDReturnDayDetailModel *)model {
    
    self.returnTitleLabel.text = model.borrow_title;
    self.returnDeadlineLabel.text = [NSString stringWithFormat:@"期数 %@", model.return_deadline];
    self.returnMoneyLabel.text = model.return_total;
    self.principalLabel.text = model.return_principal;
    self.interestLabel.text = model.return_income;
//    self.rewardLabel.text = model.return_reward;
    
    self.returnDateLabel.text = [NSString stringWithFormat:@"回款时间: %@", model.return_time];
    self.actuallyReturnDateLabel.text = [NSString stringWithFormat:@"实际回款时间: %@", model.advance_return_time];
}

@end
